package com.peach.springbootdemo.demo.model;

import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;

/**
 * @author peacher
 * @date 2019-07-29
 */
@Data
public class Demo {

    @NotEmpty(message="code不能为空")
    private String code;

    @NotEmpty(message="name不能为空")
    private String name;

    @Max(value = 100, message = "年龄不能大于100岁")
    @Min(value= 18 ,message= "必须年满18岁！" )
    private int age;

}
